How to find domain of a function